//
// Created by xili on 2024/9/3 21:10.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    long long maximumPoints(vector<int> &enemyEnergies, int currentEnergy) {
        int mn = ranges::min(enemyEnergies);
        if (currentEnergy < mn) {
            return 0;
        }
        long long s = reduce(enemyEnergies.begin(), enemyEnergies.end(), 0LL);
        return (currentEnergy + s - mn) / mn;
    }
};